﻿#region

using FluentNHibernate.Mapping;

#endregion

namespace MediaSage.Lib.Database
{
    public class EpisodeMap : ClassMap<EpisodeEntity>
    {
        #region Constructors

        public EpisodeMap()
        {
            Table("Episodes");
            Id(m => m.ID).GeneratedBy.GuidComb().UnsavedValue("00000000-0000-0000-0000-000000000000");
            Map(m => m.AbsoluteNumber);
            Map(m => m.AirsAfterSeason);
            Map(m => m.AirsBeforeSeason);
            HasOne(m => m.Banner).Cascade.All();
            HasOne(m => m.SeasonBanner).Cascade.All();
            HasMany(m => m.Cast).Cascade.All().Table("People");
            Map(m => m.DvdChapter);
            Map(m => m.DvdDiscID);
            Map(m => m.DvdEpisodeNumber);
            Map(m => m.DvdSeason);
            Map(m => m.EpisodeName);
            Map(m => m.EpisodeNumber);
            Map(m => m.FirstAired).Nullable();
            Map(m => m.IMDBID);
            Map(m => m.IsSpecial);
            Map(m => m.Language);
            Map(m => m.Overview);
            Map(m => m.ProductionCode);
            Map(m => m.Rating);
            Map(m => m.SeasonID);
            Map(m => m.SeasonNumber);
            Map(m => m.SeriesID);
            Map(m => m.TvdbID);
        }

        #endregion Constructors
    }
}